import React,{Component} from 'react'
import {is} from "immutable"
import pureRenderWOF from "pure-render-without-function"

//sortBy
const options = [
  {value:"createtime_desc",name:"录入时间由近到远"},
  {value:"createtime_esc",name:"录入时间由远到近"},
  {value:"lastLookTime_desc",name:"最好带看时间由近到远"},
  {value:"lastLookTime_esc",name:"最好带看时间由远到近"},
  {value:"lastFollowtime_desc",name:"最后跟进时间由近到远"},
  {value:"lastFollowtime_esc",name:"最后跟进时间由远到近"},
  {value:"expireDate_desc",name:"需求时间由近到远"},
  {value:"expireDate_esc",name:"需求时间由远到近"}
]



export default class  extends Component {
  constructor(props){

    super(props)


    this.state={
      value : props.value
    }
  }




  render() {


    return (
      <select value={this.state.value} onChange={this._handleChange.bind(this)} >
        {options.map(function(option){
          return (
            <option
              value={option.value} key={option.value}>
                {option.name}
            </option>
          )
        })}
      </select>)
  }
  _handleChange(event){
    this.setState({value:event.target.value})
    this.props.onChange(event)
  }
}
